<template>
  <!-- <div id="nav"></div> -->
  <button @click="btn">message垃圾</button>
  <button @click="btn2">confirm垃圾</button>
  <!-- <button @click="text">ss</button> -->
  <router-view></router-view>
  <!-- <XtxMessage text="手机号或密码错误" type="error" /> -->

  <!-- <XtxConfirm></XtxConfirm> -->
</template>
<script>
// import confirm from './components/library/confirm'
// import { Message } from './components/library/Message'
// 获得当前实例
import { getCurrentInstance } from 'vue'
export default {
  setup () {
    const { proxy } = getCurrentInstance()
    function btn () {
      // Message({ type: 'success', text: 'hhhhhhhhhhhhhh' })
      // Message.success({ text: '2164914672364' })
      // Message.error({ text: '2164914672364' })
      // 在原型上调用
      proxy.$message.error({ text: '12345rvd' })
    }
    function btn2 () {
      // confirm({ title: 'hhh', text: 'bbbbb' })
      //   .then(() => {
      //     console.log(1)
      //   })
      //   .catch(() => {
      //     console.log(2)
      //   })
      // 在原型上挂载使用
      proxy
        .$confirm()
        .then(() => {
          console.log(1)
        })
        .catch(() => {
          console.log(2)
          // console.log(err)
        })
    }
    return { btn, btn2 }
  }
}
</script>

<style></style>
